package com.joysuch.wwyt.mh.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum  TaskStatus {

    UNFINISH(0,"未完成"),
    FINISH(1,"已完成"),
    OVERDUE(2,"逾期未完成");

    private Integer status;
    private String desc;

    TaskStatus(Integer status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public Integer getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }


    public static Map<Integer, TaskStatus> getLookup() {
        return lookup;
    }

    private static final Map<Integer, TaskStatus> lookup = new HashMap<>();

    static {
        for (TaskStatus e : EnumSet.allOf(TaskStatus.class)) {
            lookup.put(e.status, e);
        }
    }

    public static TaskStatus find(Integer status) {
        return lookup.get(status);
    }
}
